Lesson3 有一些些題目需要多加思考
一樣下面也將提供各題參考解答
(⭐代表加碼題目)
前面幾題是蠻基本的正負判斷、基數、偶數
a = int(input())
if a > 0:
print('YES')
else:
print('NO')
a = int(input())
if a%2 == 0:
print('NO')
else:
print('YES')
a = int(input())
if a%2 == 0:
print('YES')
else:
print('NO')
a = int(input())
if ((a-7)%10==0):
print('YES')
else:
print('NO')
a = int(input())
b = int(input())
if a-b>0:
print(b)
else:
print(a)
a = int(input())
b = int(input())
if (a%2==1 and b%2==1):
print('YES')
else:
print('NO')
a = int(input())
b = int(input())
if (a%2==1 or b%2==1):
print('YES')
else:
print('NO')
a = int(input())
b = int(input())
if (a%2==1 and b%2==0) or (a%2==0 and b%2==1):
print('YES')
else:
print('NO')
a = int(input())
if a==0:
print('0')
elif a>0:
print('1')
else:
print('-1')
a = int(input())
b = int(input())
c = int(input())
if a < b and b < c:
print('YES')
else:
print('NO')
a = int(input())
if (100<=a<=999):
print('YES')
else:
print('NO')
a = int(input())
b = int(input())
c = int(input())
if (a<b and a<c):
print(a)
elif(b<a and b<c):
print(b)
else:
print(c)
a = int(input())
b = int(input())
c = int(input())
if (a==b and b==c):
print('3')
elif (a==b or a==c or b==c):
print('2')
else:
print('0')